package com.zlll.winner.util;

import java.util.regex.Pattern;

public class RegexMatcherUtil {
    public final static Pattern NotChinese = Pattern.compile("[\\u4e00-\\u9fa5]");
    public final static Pattern MobileNum = Pattern.compile("^\\d{11}$");

    private static Pattern[] COMPLEX_PATTERN = new Pattern[]{
            Pattern.compile("[A-Z]"),
            Pattern.compile("[a-z]"),
            Pattern.compile("[0-9]"),
            Pattern.compile("[\\W_]")};
    public static int countComplex( String password){
        int count = 0;
        for (Pattern p : COMPLEX_PATTERN) {
            if(p.matcher(password).find()) count++;
        }
        return count;
    }

}
